<template>
  <div class="cu-common-layout">
    <div class="cu-common-layout-center">
      <el-row class="cu-common-search-box" :gutter="16">
        <el-form @submit.native.prevent>
          <el-col :span="6">
            <el-form-item label="关键字">
              <el-input v-model="query.keywords" placeholder="关键字" clearable />
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="状态">
              <el-select v-model="query.status" placeholder="状态">
                <el-option v-for="(item, index) in statusOptions" :key="index" :label="item.fullName" :value="item.enCode" />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item>
              <el-button type="primary" icon="el-icon-search" @click="search()">查询</el-button>
              <el-button icon="el-icon-refresh-right" @click="reset()">重置</el-button>
            </el-form-item>
          </el-col>
        </el-form>
      </el-row>
      <div class="cu-common-layout-main cu-flex-main">
        <div class="cu-common-head">
          <div>
            <el-button type="primary" icon="el-icon-plus" @click="addOrUpdateHandle()">新增</el-button>
          </div>
          <div class="cu-common-head-right">
            <el-tooltip effect="dark" content="刷新" placement="top">
              <el-link icon="icon-ym icon-ym-Refresh cu-common-head-icon" :underline="false" @click="reset()" />
            </el-tooltip>
            <screenfull isContainer />
          </div>
        </div>
        <custom-table v-loading="listLoading" :data="list">
          <!-- <el-table-column label="问题分类" prop="category" align="left">
            <template slot-scope="scope">
              {{ scope.row.category | dynamicCodeText(categoryOptions) }}
            </template>
          </el-table-column> -->
          <el-table-column label="问题来源" prop="sourse" align="left">
            <template slot-scope="scope">
              {{ scope.row.sourse | dynamicTreeCodeText(sourseOptions) }}
            </template>
          </el-table-column>
          <el-table-column prop="question" label="问题描述" align="left" width="200" />
          <el-table-column prop="createTime" label="录入时间" align="left" width="120" :formatter="custom.tableDateTimeFormat" />
          <el-table-column prop="solutions" label="标准答案" align="left" min-width="200" />
          <el-table-column prop="keywords" label="关键词" align="left" width="160" />
          <el-table-column prop="status" label="当前状态" align="left" width="120">
            <template slot-scope="scope">
              {{ scope.row.status | dynamicCodeText(statusOptions) }}
            </template>
          </el-table-column>
          <el-table-column label="操作" fixed="right" width="100">
            <template slot-scope="scope">
              <el-button type="text" @click="addOrUpdateHandle(scope.row.id)">编辑</el-button>
              <el-button type="text" @click="handleDel(scope.row.id)" class="Manage-table-delBtn">删除</el-button>
            </template>
          </el-table-column>
        </custom-table>
        <pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize" @pagination="initData" />
      </div>
    </div>
    <custom-form v-if="formVisible" ref="CustomForm" @refresh="refresh" />
    <records-form v-if="recordsVisible" ref="RecordsForm" @refresh="refresh" />
    <!-- <ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download" /> -->
  </div>
</template>
<script>
export { default } from './index.js'
</script>
